package java0415homework;

public class Staff {
	// 员工号，员工姓名、工员年龄，员工工资。
	public Staff() {

	}

	public Staff(int staffNum, String name, int age, double wage) {
		super();
		StaffNum = staffNum;
		this.name = name;
		this.age = age;
		Wage = wage;
	}

	private int StaffNum;
	private String name;
	private int age;
	private double Wage;

	public int getStaffNum() {
		return StaffNum;
	}

	public void setStaffNum(int staffNum) {
		StaffNum = staffNum;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public double getWage() {
		return Wage;
	}

	public void setWage(double wage) {
		Wage = wage;
	}

	@Override
	public int hashCode() {
		return this.StaffNum + this.name.hashCode();
	}

	// 如果两个学生对象的学号和姓名相等，认为是同一个学生对象
	@Override
	public boolean equals(Object anObj) {
		if(this == anObj) 
			return true;
		if(!(anObj instanceof Staff)) 
			return false;
		Staff other = (Staff)anObj;
		if(this.StaffNum == other.StaffNum) {
			return true;
		}
		return false;
}
